// vim:ft=javascript

ARG_WITH("pgsql", "PostgreSQL support", "no");

if (PHP_PGSQL != "no") {
	if (CHECK_LIB("libpq.lib", "pgsql", PHP_PGSQL) &&
		CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PGSQL", PHP_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;" + PHP_PGSQL)) {
		EXTENSION("pgsql", "pgsql.c", PHP_PGSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
		AC_DEFINE('HAVE_PGSQL', 1, 'Have PostgreSQL library');
		ADD_FLAG("CFLAGS_PGSQL", "/D PGSQL_EXPORTS /D HAVE_PQFREEMEM /D HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT" + (X64 ? " /D HAVE_PG_LO64" : "") + " ");
	} else {
		WARNING("pgsql not enabled; libraries and headers not found");
	}
}
